package cn.com;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.MysqlLeiBie;

public class UpzhutiServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public UpzhutiServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		MysqlLeiBie my = new MysqlLeiBie();
		String tname = request.getParameter("upname");
		String tid = request.getParameter("tid");
		// if (tid != null || tname != null) {
		int tid1 = Integer.parseInt(tid);
		int gg = my.upLeiBei(tid1, tname);
		response.sendRedirect("showzhutiServlet");
	}

	/**
	 * Initialization of the servlet. <br>
	 * 
	 * @throws ServletException
	 *             if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
